<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta charset="utf-8">
    <meta http-equiv="Cache-Control" content="no-siteapp">
    <title>支付</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link href="/public/static/homes/css/iconfont/iconfont.css" rel="stylesheet"/>
    <link href="/public/static/homes/css/common.css" rel="stylesheet"/>
    <link href="/public/static/homes/css/cart.css" rel="stylesheet"/>
    <style>
        .none{
            display: none;
        }
    </style>
</head>
<body class="graybg-theme">
    <!--头部-->
        {:widget("Cate/header")}
        <div class="cart-header wrapper">
            <div class="logo">
                <a href="index.html"><img src="/public/static/homes/img/logo.png" alt="logo" /></a>
            </div>
            <div class="step-box">
                <div class="row">
                    <div class="step first active col-3">
                        <span class="num">1</span><span class="line"></span><span class="label">我的购物车</span>
                    </div>
                    <div class="step active col-3">
                        <span class="num">2</span><span class="line"></span><span class="label">确认订单信息</span>
                    </div>
                    <div class="step active col-3">
                        <span class="num">3</span><span class="line"></span><span class="label">选择支付方式</span>
                    </div>
                    <div class="step last col-3">
                        <span class="num">4</span><span class="line"></span><span class="label">完成付款</span>
                    </div>
                </div>
            </div>
        </div>
    <!--头部-->
    
    <div class="wrapper">
        <div class="pay-wrap" id="box">
            <div class="order-result">
                <div class="section clearfix">
                    <img src="/public/static/homes/img/ico/order-success.jpg" class="ico" />
                    <div class="titbox">
                        <input type="hidden" name="oid" value="{$oid}" id="orderid">
                        <div class="tit">订单提交成功，应付金额 {$result['money']} 元</div>
                        <div class="stit">订单号：{$result['orderid']}    请您在 <span id="ss" style="color:red;">1</span> 日 内完成支付，否则订单会被自动取消</div>
                    </div>
                    <div class="mt20">
                        <div class="meta">
                            <div class="hd">商品</div>
                            {foreach name="info" item="value"}
                            <div class="bd">{$value['name']} *{$value['num']}</div>
                            {/foreach}
                        </div>
                        <div class="meta">
                            <div class="hd">收货地址</div>
                            <div class="bd">{$result['site']}  ({$result['linkname']} 收) {$result['phone']} <a href="">[修改]</a></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="pay-wrap-tit">
            在线支付
        </div>
        <div class="pay-wrap zhifu">
            <div class="pay-way">
                <div class="row">
                    <div class="col col-3">
                        <label><input class="check" type="radio" name="a" /><img src="/public/static/homes/img/pay/zfb.jpg" /></label>
                    </div>
                    <div class="col col-3">
                        <label><input class="check" type="radio" name="a" /><img src="/public/static/homes/img/pay/weixin.jpg" /></label>
                    </div>
                </div>
                <div class="row">
                    <div class="col col-3">
                        <label><input class="check" type="radio" name="a" /><img class="bd" src="/public/static/homes/img/pay/zgyh.jpg" /></label>
                    </div>
                    <div class="col col-3">
                        <label><input class="check" type="radio" name="a" /><img class="bd" src="/public/static/homes/img/pay/jsyh.jpg" /></label>
                    </div>
                    <div class="col col-3">
                        <label><input class="check" type="radio" name="a" /><img class="bd" src="/public/static/homes/img/pay/nyyh.jpg" /></label>
                    </div>
                    <div class="col col-3">
                        <label><input class="check" type="radio" name="a" /><img class="bd" src="/public/static/homes/img/pay/gsyh.jpg" /></label>
                    </div>
                    <div class="col col-3">
                        <label><input class="check" type="radio" name="a" /><img class="bd" src="/public/static/homes/img/pay/jtyh.jpg" /></label>
                    </div>
                    <div class="col col-3">
                        <label><input class="check" type="radio" name="a" /><img class="bd" src="/public/static/homes/img/pay/zsyh.jpg" /></label>
                    </div>
                    <div class="col col-3">
                        <label><input class="check" type="radio" name="a" /><img class="bd" src="/public/static/homes/img/pay/yzcxyh.jpg" /></label>
                    </div>
                    <div class="col col-3">
                        <label><input class="check" type="radio" name="a" /><img class="bd" src="/public/static/homes/img/pay/xyyy.jpg" /></label>
                    </div>
                </div>
            </div>
        </div>
        <div class="bottom-panel" >
            <a href="/myorder/index/user_id/{$Think.session.uid}" class="go-next ui-btn-theme">回到订单中心</a>
            <a href="/pay/payok/orderid/{$result['orderid']} " class="go-next ui-btn-theme">去支付</a>
        </div>
    </div>

    <!--脚部-->
    <div class="fatfooter">

    </div>
    <!--脚部-->
</body>
<script src="/public/static/homes/js/jquery.js"></script>
<link rel="stylesheet" href="/public/static/homes/js/icheck/style.css"/>
<script src="/public/static/homes/js/icheck/icheck.min.js"></script>
<script src="/public/static/homes/js/global.js"></script>
<script>
 //判断总价是否为0来判断是否是自动刷新当前页面
    if ($('.tit').html() == '订单提交成功，应付金额 0 元') {
        window.location='/homeindex/index';
    }else{

        //订单倒计时
        //声明要倒计时的秒数
        var seconds = 86400;//1小时 20分钟 3秒
        //调用run
        run();
        //定时器
        var timmer = setInterval(run,1000);
        //定义函数
        function run(){
            //判断  如果倒计时结束
            if(seconds <= 0){
                id = $('#orderid').val();
                $.get('/pay/delorder',{id:id},function(data){
                    if(data > 0){
                        document.getElementById('box').innerHTML = '<span class="xx" style="font-size:30px">超时未支付，订单已取消! <a href="/homeindex/index" style="color:red">返回商城首页</a></span>';
                        $('.pay-wrap-tit').attr('class','pay-wrap-tit none');
                        $('.pay-wrap zhifu').attr('class','pay-wrap zhifu none');
                        $('.bottom-panel').attr('class','bottom-panel none');
                    }
                });
                
                clearInterval(timmer);
                return;
            }

            //取出倒计时秒数中的小时数
            var h = Math.floor(seconds/3600);
            //获取分钟数
            var s = seconds - h*3600;
            var m = Math.floor(s/60);
            //获取秒数
            s = s - m*60;
            //处理 时 分 秒的格式
            h = (h>9)?h:'0'+h;
            m = (m>9)?m:'0'+m;
            s = (s>9)?s:'0'+s;

            //把时 分 秒 输出到指令位置
            var timeStr = ':'+h+'时'+m+'分'+s+'秒';
            document.getElementById('ss').innerHTML = timeStr;

            //秒数 -1
            seconds --;
        }
   }
</script>
</html>